/*
	PROG: cbuying
	LANG: C++
	ID: luiza1
*/

#include <stdio.h>
#include <algorithm>
using namespace std;

typedef struct choc {
	unsigned long long int nCows;
	unsigned long long int price;
} Choc;

int N;
Choc chocs[100010];
long long int B;
long long int cows;

bool cmp(Choc a, Choc b) {
	return a.price<b.price;
}

int main() {
	freopen("cbuying.in", "r", stdin);
	freopen("cbuying.out", "w", stdout);

	scanf("%d%lld", &N, &B);

	for (int i=0; i<N; i++) 
		scanf("%lld%lld", &chocs[i].price, &chocs[i].nCows);

	cows=0;

	sort(chocs, chocs+N, cmp);

//	for (int i=0; i<N; i++)
//		printf("%lld %lld\n", chocs[i].nCows, chocs[i].price);

	bool finish=false;

	for (int i=0; i<N; i++) {
		long long int numCows= B/chocs[i].price;

		if (numCows>=chocs[i].nCows) {
			B-=chocs[i].nCows*chocs[i].price;
			cows+=chocs[i].nCows;
		}
		else {
			cows+=numCows;
			break;
		}
	}

	printf("%lld\n", cows);
	
	return 0;
}
